<?php

    return function(){
        $attrbutes = [
            'prefix'        => \Encore\Admin\Facades\Admin::url($this->modulePrefix),
            'namespace'     => 'App\Winged\\Common\\Controllers',
        ];
        $middleware = [
            'basic' => ['web','admin'],
        ];
        $attrbutes['middleware'] = $middleware ['basic'];
        /* 浏览权限 */
        Route::group($attrbutes ,function(\Illuminate\Routing\Router $router){
            $router->get('/article','ArticleController@index');
            $router->get('/articleList','ArticleController@getArticleList');
            $router->post('/article','ArticleController@create');
            $router->post('/article/upload','ArticleController@upload');
            $router->put('/article','ArticleController@update');
            $router->post('/preview','ArticleController@preview');
            $router->any('/departments','DepartmentController@index');
            $router->get('/config/key','ConfigController@key')->middleware(['permission:allow,' . \App\Winged\Auth\Consts\Roles::MASTER_SUPERADMIN . ',' . \App\Winged\Auth\Consts\Roles::TENANT_ADMIN]);
            $router->get('/config','ConfigController@config')->middleware(['permission:allow,' . \App\Winged\Auth\Consts\Roles::MASTER_SUPERADMIN . ',' . \App\Winged\Auth\Consts\Roles::TENANT_ADMIN]);
            $router->get('/config/microserve','ConfigController@microserve')->middleware(['permission:allow,' . \App\Winged\Auth\Consts\Roles::MASTER_SUPERADMIN ]);

            // 新增文章分类
            $router->post('/article/add_category','ArticleController@addCategory');
            // 获取文章分类
            $router->get('/article/category','ArticleController@getCategory');

        });
    };
